package flc.ast.activity;

import androidx.appcompat.app.AppCompatActivity;
import androidx.recyclerview.widget.GridLayoutManager;

import android.os.Bundle;

import java.util.ArrayList;
import java.util.List;

import flc.ast.BaseAc;
import flc.ast.R;
import flc.ast.adapter.StarOverviewAdapter;
import flc.ast.bean.StarsBean;
import flc.ast.databinding.ActivityStarOverviewBinding;
import stark.common.basic.event.EventStatProxy;

public class StarOverviewActivity extends BaseAc<ActivityStarOverviewBinding> {

    private List<StarsBean> listStar = new ArrayList<>();
    private StarOverviewAdapter starOverviewAdapter;

    @Override
    protected int onCreate() {
        return R.layout.activity_star_overview;
    }

    @Override
    protected void initView() {
        EventStatProxy.getInstance().statEvent1(this, mDataBinding.event1Container);

        mDataBinding.ivStarOverviewBack.setOnClickListener(v -> onBackPressed());

        mDataBinding.rvStarList.setLayoutManager(new GridLayoutManager(mContext, 3));
        starOverviewAdapter = new StarOverviewAdapter();
        mDataBinding.rvStarList.setAdapter(starOverviewAdapter);
    }

    @Override
    protected void initData() {
        getData();
    }

    private void getData() {
        listStar.add(new StarsBean(getString(R.string.star_sign11), R.drawable.aimg_xz1_sp, getString(R.string.birth_date11)));
        listStar.add(new StarsBean(getString(R.string.star_sign12), R.drawable.aimg_xz1_sy, getString(R.string.birth_date12)));
        listStar.add(new StarsBean(getString(R.string.star_sign1), R.drawable.aimg_xz1_by, getString(R.string.birth_date1)));
        listStar.add(new StarsBean(getString(R.string.star_sign2), R.drawable.aimg_xz1_jn, getString(R.string.birth_date2)));
        listStar.add(new StarsBean(getString(R.string.star_sign3), R.drawable.aimg_xz1_sz2, getString(R.string.birth_date3)));
        listStar.add(new StarsBean(getString(R.string.star_sign4), R.drawable.aimg_xz1_jx, getString(R.string.birth_date4)));
        listStar.add(new StarsBean(getString(R.string.star_sign5), R.drawable.aimg_xz1_sz, getString(R.string.birth_date5)));
        listStar.add(new StarsBean(getString(R.string.star_sign6), R.drawable.aimg_xz1_cn, getString(R.string.birth_date6)));
        listStar.add(new StarsBean(getString(R.string.star_sign7), R.drawable.aimg_xz1_tc, getString(R.string.birth_date7)));
        listStar.add(new StarsBean(getString(R.string.star_sign8), R.drawable.aimg_xz1_tx, getString(R.string.birth_date8)));
        listStar.add(new StarsBean(getString(R.string.star_sign9), R.drawable.aimg_xz1_ss, getString(R.string.birth_date9)));
        listStar.add(new StarsBean(getString(R.string.star_sign10), R.drawable.aimg_xz1_mx, getString(R.string.birth_date10)));
        starOverviewAdapter.setList(listStar);
    }

}